<!doctype html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Serialize scheduler events</title>
</head>
	<script src="../../codebase/dhtmlxscheduler.js?v=5.2.1" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/ext/dhtmlxscheduler_serialize.js?v=5.2.1" type="text/javascript" charset="utf-8"></script>

	<link rel="stylesheet" href="../../codebase/dhtmlxscheduler_material.css?v=5.2.1" type="text/css" charset="utf-8">
	<link rel="stylesheet" href="../common/controls_styles.css?v=5.2.1">
	
<style type="text/css" >
	html, body{
		margin:0px;
		padding:0px;
		height:100%;
		overflow:hidden;
	}	
	.dhx_cal_navline input{
		width:80px;
		position:absolute;
		top:1px;
		font-family:Tahoma;
		font-weight:8pt;
	}
</style>


<script type="text/javascript" charset="utf-8">
	function init() {
		scheduler.config.prevent_cache = true;
		scheduler.xy.margin_top=30;
		
		scheduler.init('scheduler_here',new Date(2018,0,20),"month");
		scheduler.load("../common/events.json");
	}
	
	function toXML(){
		return show(scheduler.toXML());
	}
	function toJSON(){
		return show(scheduler.toJSON());
	}
	function toICal(){
		return show(scheduler.toICal());
	}
	function show(content) {
		dhtmlx.alert({
			text: '<textarea style="max-height:300px" rows="30" cols="90" style="border:none;" data-role="none">'+content+'</textarea>',
			type: "alert",
			width: '700px',
			height:'400px'
		});
	}

</script>

<body onload="init();">
	<div class="sch_control">
		<input type="button" name="xml" value="To XML" onclick="toXML()"/>
		<input type="button" name="json" value="To JSON" onclick="toJSON()"/>
		<input type="button" name="ical" value="To iCal" onclick="toICal()"/>
	</div>
	<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
		</div>
		<div class="dhx_cal_header">
		</div>
		<div class="dhx_cal_data">
		</div>		
	</div>
</body>
